﻿$(document).ready(function() {
    $(".hd-text")
    .css("color", "#CCC")
    .focus(function() { $(this).val('').css("color", "#000") })
    .keydown(function(event) {
        switch (event.keyCode) {
            case 13:
                if ($(this).length > 0) {
                    document.location.href = "http://search.m18.com/SearchResult.aspx?keyword=" + escape($(".hd-text").val());
                }
                break;
        }
    });

    $(".hd-sbt").click(function() {
        if ($(".hd-text").val().length > 0 & $(".hd-text").val() != "请输入您要找的商品") {
            document.location.href = "http://search.m18.com/SearchResult.aspx?keyword=" + escape($(".hd-text").val());
        }
    });
});
